<template>
    <div >
   
        <router-view class="view"></router-view>
        
        <!-- 底部导航 -->
        <!-- <footer class="footer">
            <router-link to="/index/store" active-class="active"><img :src="home_y" alt="">商城</router-link>
            <router-link to="/index/cate" active-class="active">分类</router-link>
            <router-link to="/index/shop" active-class="active">购物车</router-link>
            <router-link to="/index/mine" active-class="active">我的</router-link>
            
        </footer> -->
      <footer class="footer2">
      <router-link v-for="item in navs" :key="item.path" :to="item.path" active-class="select">
        <img :src="$route.path===item.path?item.select_img:item.no_select" alt="">
        <div>{{item.name}}</div>
      </router-link>
    </footer>
  </div>
</template>
    </div>
</template>
<script>
import home_y from '../../assets/img/home_y.jpeg'
import home_n from '../../assets/img/home_n.jpeg'
import cate_y from '../../assets/img/cate_y.jpeg'
import cate_n from '../../assets/img/cate_n.jpeg'
import shop_y from '../../assets/img/shop_y.jpeg'
import shop_n from '../../assets/img/shop_n.jpeg'
import mine_y from '../../assets/img/mine_y.jpeg'
import mine_n from '../../assets/img/mine_n.jpeg'
export default {
    data(){
    return {
      navs:[
        {
          path:"/index/store",
          name:"首页",
          select_img:home_y,
          no_select:home_n
        },
         {
          path:"/index/cate",
          name:"分类",
          select_img:cate_y,
          no_select:cate_n
        },
         {
          path:"/index/shop",
          name:"购物车",
          select_img:shop_y,
          no_select:shop_n
        },
         {
          path:"/index/mine",
          name:"我的",
          select_img:mine_y,
          no_select:mine_n
        },
      ]
    }
  }
}
</script>
<style scoped>
.view{
  padding-bottom: 0.8rem;
}

.footer2{
  height: 1rem;
  position: fixed;
  width: 100vw;
  background: #fff;
  left: 0;
  bottom: 0;
  border-top: 0.01rem solid #ccc;
  display: flex;
}
.footer2 a{
  flex: 1;
  text-align: center;
}
.footer2 a img{
  width: 0.5rem;
  height: 0.5rem;
}
.footer2 a div{
  font-size: 0.24rem;
  line-height: 0.5rem;
  color:pink;
}
.footer2 .select div{
  color: pink;
}







.footer{
  width: 100vw;
  height: 0.8rem;
  border-top: 0.01rem solid #ccc;
  position: fixed;
  left: 0rem;
  bottom: 0rem;
  display: flex;
  background: #fff;
}
.footer a{
  flex: 1;
  text-align:center;
  line-height: 0.8rem;
  color:#333;
}
.footer .router-link-active{
  color: blue;
}

.footer .active{
  color:#ff4400;
}
</style>
